#定义变量
CXX := g++
CXXFLAGS := -std=c++11 -Wall
TARGET := bin/file_manager
SRC :=src/main.cpp
TESTPATH := /home/Shemol/Verdandi/IFM/IFM_v0.4/test/
ALLPATH := $(TESTPATH)test01/ $(TESTPATH)test02/ $(TESTPATH)test03/
TEST_FILES := aaa.txt aa.cpp aaa.java aaa.exe aaa.jpg bbb.txt ccc.txt \
	ccc.exe ccc.cpp bbb.exe a.txt a.cpp b.txt aaa bbb

all: $(TARGET) 

$(TARGET): $(SRC)
	mkdir -p bin
	$(CXX) $(CXXFLAGS) -o $(TARGET) $(SRC)

test: test01 test02 test03

test01 test02 test03: test%:
	mkdir -p test/$@
	@for file in $(TEST_FILES); do \
		touch test/$@/$$file; \
		done
	@echo "创建测试目录: test/$@"

run:
	./$(TARGET) $(ALLPATH)

clean:
	rm -rf bin
	rm -rf test
